// JavaScript Document

// JavaScript Document
// JavaScript Document

function valid()
{
	if ( document.contact.fname.value == "" )
	{
		alert("Please Enter Your Name !");
		document.contact.fname.focus();
		return false;
	}
	
	if ( document.contact.email.value == "" )
	{
		alert("Please Enter Your Email !");
		document.contact.email.focus();
		return false;
	}
	else
		{
			
				var x = document.forms["contact"]["email"].value;
				var atpos = x.indexOf("@");
				var fdotpos = x.indexOf(".");
				var dotpos = x.lastIndexOf(".");
				if (atpos < 1 || dotpos<atpos+2 || dotpos+2 >= x.length || fdotpos < 1)
		  		{
					alert("Not a valid e-mail address");
					document.contact.email.focus();
		  			return false;
		  		}
			
	}
	
	if ( document.contact.title.value == "" )
	{
		alert("Please Enter the Title !");
		document.contact.title.focus();
		return false;
	}
	
	if ( document.contact.message.value == "" )
	{
		alert("Please Enter Your Message !");
		document.contact.message.focus();
		return false;
	}	
	return true;
}

function clearvalid()
{
	document.contact.fname.value = "";
	document.contact.email.value = "";
	document.contact.title.value = "";
	document.contact.message.value = "";
	return false;
	
}